<script type="text/javascript" src="js/jquery.simplemodal.js"></script>
<script type="text/javascript" src="js/init.js"></script>
<link type='text/css' href='css/stylesheet.css' rel='stylesheet' media='screen' />
<link type='text/css' href='css/basic.css' rel='stylesheet' media='screen' />
<?php 
    global $user;
    $my=$user->get(); 
?>
<div class="loginorregis">
    Xin chào <?php echo $my->fullname; ?> | <a href="<?php echo $config->live_site; ?>index.php?com=user&t=logout">Thoát</a><br />
    <a id="edit_link" href="#" >Cập nhật thông tin</a><br />
    <a id="share_" href="#" >Chia sẻ kình nghiệm</a>
</div>

<div id="edit_form" style="display: none;">
    <center><h1><img src="images/users_edit.png" align="absmiddle">&nbsp;Cập nhật thông tin</h1> 
    
    <div id="edit_response"><!-- spanner --></div> </center>
    <form name="signup-form" action="<?php echo Route::_() ?>" method="post">
    <table class="table-form-adduser">
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('FULLNAME') ?>:
            </td>
            <td class="table-form-adduser-input">
                <input type="text" name="fullname" value="<?php echo $this->user->fullname ?>" />
            </td>
        </tr>
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('OLDPASSWORD') ?>:
            </td>
            <td class="table-form-adduser-input">
                <input type="password" name="oldpassword" />
            </td>
        </tr>
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('PASSWORD') ?>:
            </td>
            <td class="table-form-adduser-input">
                <input type="password" name="password"  />
            </td>
        </tr>
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('REPASSWORD') ?>:
            </td>
            <td class="table-form-adduser-input">
                <input type="password" name="repassword" />
            </td>
        </tr>
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('PHONE') ?>:
            </td>
            <td class="table-form-adduser-input">
                <input type="text" name="phone" value="<?php echo $this->user->phone ?>" />
            </td>
        </tr>
        
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('CITY') ?>:
            </td>
            <td class="table-form-adduser-input" align="left">
                <select name="cityid">
                        <?php foreach($this->citys as $city):?>
                            <option <?php if((int)$city->id==(int)$this->user->cityid){?> selected="selected" <?php }?> value="<?php echo $city->id?>"><?php echo utf8_decode($city->city) ?></option>
                        <?php endforeach;?>
                </select>
            </td>
        </tr>
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('ADDRESS') ?>:
            </td>
            <td class="table-form-adduser-input">
                <textarea cols="30" rows="4" name="address"><?php echo $this->user->address ?></textarea>
            </td>
        </tr>
        <tr>
            <td class="table-form-adduser-label">
                <?php echo Resources::_('CAPTCHA') ?>:
            </td>
            <td class="table-form-adduser-input" align="left">
                <?php echo HTML::showcaptcha('user_edit')?>
            </td>
        </tr>
        <tr>
            <td class="table-form-adduser-label">
            </td>
            <td class="table-form-adduser-input">
                <input type="text" name="captcha" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input  type="submit" id="edit_submit" style="float: none;"  value="<?php echo Resources::_('SAVE')?>"/><input style="float: none;"  type="button" onclick="go_to_private_page()" value="<?php echo Resources::_('Hủy')?>"/>
            </td>
        </tr>
    </table>
     <div id="edit_ajax_loading" style="display: none;">
            <img align="absmiddle" src="images/spinner.gif" />&nbsp;Processing... 
        </div>
</form>
</div>
